package com.github.data_manage.domain.po

import cn.idev.excel.annotation.ExcelIgnore
import cn.idev.excel.annotation.ExcelProperty
import com.github.data_manage.util.ListStringJsonConverter
import jakarta.persistence.*
import jakarta.validation.constraints.NotBlank
import java.math.BigDecimal

/**
 * @author chenhainan
 * @since 2024-08-15 09:04
 */
@Entity
@Table(name = "t_investments", uniqueConstraints = [UniqueConstraint(columnNames = ["name"])])
open class Investments {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @ExcelIgnore
    open var id: Int? = null

    @ExcelProperty("名称", index = 0)
    @NotBlank
    open var name: String? = null

    // 规模
    @Column(columnDefinition = "decimal(38,2) default 0")
    @ExcelProperty("规模", index = 1)
    open var aum: BigDecimal? = null

    // 类别
    @ExcelProperty("类别", index = 2)
    open var type: String? = null

    // ticker
    @ExcelProperty("ticker", index = 3)
    open var ticker: String? = null

    // 标签
//    @Convert(converter = ListStringJsonConverter::class)
    @ExcelProperty("标签", index = 4)
    open var tags: String? = null

    // 行业
    @ExcelProperty("行业", index = 5)
    open var industry: String? = null

    // 市值
    @ExcelProperty("市值", index = 6)
    open var marketValue: String? = null

    // 地区
    @ExcelProperty("地区", index = 7)
    open var region: String? = null

    // 市盈率
    @ExcelProperty("市盈率", index = 8)
    open var per: BigDecimal? = null

    // 市净率
    @ExcelProperty("市净率", index = 9)
    open var ptr: BigDecimal? = null

    // 市销率
    @ExcelProperty("市销率", index = 10)
    open var msr: BigDecimal? = null

    // 收入增长率
    @ExcelProperty("收入增长率", index = 11)
    open var igr: BigDecimal? = null

    // 利润增长率
    @ExcelProperty("利润增长率", index = 12)
    open var pgr: BigDecimal? = null

    // 毛利率
    @ExcelProperty("毛利率", index = 13)
    open var gpm: BigDecimal? = null

    // 净利率
    @ExcelProperty("净利率", index = 14)
    open var npm: BigDecimal? = null

    // 流动性
    @ExcelProperty("流动性", index = 15)
    open var mobility: BigDecimal? = null

    // ytd
    @ExcelProperty("ytd", index = 16)
    open var ytd: BigDecimal? = null

    // mtd
    @ExcelProperty("mtd", index = 17)
    open var mtd: BigDecimal? = null

    // 过去三个月表现
    @ExcelProperty("过去三个月表现", index = 18)
    open var performance: BigDecimal? = null

    // 备注
    @ExcelProperty("备注", index = 19)
    open var note: String? = null
}
